package com.qf.domain;

import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

public class Questions {
//    @NotNull(message = "id不能为空")
    private Integer id;//id
    @NotNull(message = "title不能为空")
    private String title;//问题名

    private String detaiDesc;//问题描述
//    @NotNull(message = "id不能为空")
    private Integer answerCount;//回答次数
//    @NotNull(message = "id不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date lastModified;

    public Questions() {
    }

    public Questions(Integer id, String title, String detaiDesc, Integer answerCount, Date lastModified) {
        this.id = id;
        this.title = title;
        this.detaiDesc = detaiDesc;
        this.answerCount = answerCount;
        this.lastModified = lastModified;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDetaiDesc() {
        return detaiDesc;
    }

    public void setDetaiDesc(String detaiDesc) {
        this.detaiDesc = detaiDesc;
    }

    public Integer getAnswerCount() {
        return answerCount;
    }

    public void setAnswerCount(Integer answerCount) {
        this.answerCount = answerCount;
    }

    public Date getLastModified() {
        return lastModified;
    }

    public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
    }

    @Override
    public String toString() {
        return "questions{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", detaiDesc='" + detaiDesc + '\'' +
                ", answerCount=" + answerCount +
                ", lastModified=" + lastModified +
                '}';
    }
}
